home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / Disks.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  3.7 KB  |  168 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Disks.h
  3.  
  4.      Contains:    Disk Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1985-1991,1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DISKS__
  18. #define __DISKS__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __OSUTILS__
  24. #include <OSUtils.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_STRUCT_ALIGN
  42.     #pragma options align=mac68k
  43. #elif PRAGMA_STRUCT_PACKPUSH
  44.     #pragma pack(push, 2)
  45. #elif PRAGMA_STRUCT_PACK
  46.     #pragma pack(2)
  47. #endif
  48.  
  49.  
  50. enum {
  51.     sony                        = 0,
  52.     hard20                        = 1
  53. };
  54.  
  55. /* Disk Driver Status csCodes */
  56.  
  57. enum {
  58.     kReturnFormatList            = 6,                            /* .Sony */
  59.     kDriveStatus                = 8,
  60.     kMFMStatus                    = 10
  61. };
  62.  
  63. /* Disk Driver Control csCodes */
  64.  
  65. enum {
  66.     kVerify                        = 5,
  67.     kFormat                        = 6,
  68.     kEject                        = 7,
  69.     kSetTagBuffer                = 8,                            /* .Sony */
  70.     kTrackCache                    = 9,                            /* .Sony */
  71.     kDriveIcon                    = 21,
  72.     kMediaIcon                    = 22,
  73.     kDriveInfo                    = 23,
  74.     kRawTrack                    = 18244                            /* .Sony: “diagnostic” raw track dump */
  75. };
  76.  
  77. /*
  78.     Note:
  79.  
  80.     qLink is usually the first field in queues, but back in the MacPlus
  81.     days, the DrvSts record needed to be expanded.  In order to do this without
  82.     breaking disk drivers that already added stuff to the end, the fields
  83.     where added to the beginning.  This was originally done in assembly language
  84.     and the record was defined to start at a negative offset, so that the qLink
  85.     field would end up at offset zero.  When the C and pascal interfaces where
  86.     made, they could not support negative record offsets, so qLink was no longer
  87.     the first field.  Universal Interfaces are auto generated and don't support
  88.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a
  89.     none zero offset.  Assembly code which switches to Universal Interfaces will
  90.     need to compensate for that.
  91.  
  92. */
  93.  
  94.  
  95. struct DrvSts {
  96.     short                             track;                        /* current track */
  97.     char                             writeProt;                    /* bit 7 = 1 if volume is locked */
  98.     char                             diskInPlace;                /* disk in drive */
  99.     char                             installed;                    /* drive installed */
  100.     char                             sides;                        /* -1 for 2-sided, 0 for 1-sided */
  101.     QElemPtr                         qLink;                        /* next queue entry */
  102.     short                             qType;                        /* 1 for HD20 */
  103.     short                             dQDrive;                    /* drive number */
  104.     short                             dQRefNum;                    /* driver reference number */
  105.     short                             dQFSID;                        /* file system ID */
  106.     char                             twoSideFmt;                    /* after 1st rd/wrt: 0=1 side, -1=2 side */
  107.     char                             needsFlush;                    /* -1 for MacPlus drive */
  108.     short                             diskErrs;                    /* soft error count */
  109. };
  110. typedef struct DrvSts                    DrvSts;
  111.  
  112. struct DrvSts2 {
  113.     short                             track;
  114.     char                             writeProt;
  115.     char                             diskInPlace;
  116.     char                             installed;
  117.     char                             sides;
  118.     QElemPtr                         qLink;
  119.     short                             qType;
  120.     short                             dQDrive;
  121.     short                             dQRefNum;
  122.     short                             dQFSID;
  123.     short                             driveSize;
  124.     short                             driveS1;
  125.     short                             driveType;
  126.     short                             driveManf;
  127.     short                             driveChar;
  128.     char                             driveMisc;
  129. };
  130. typedef struct DrvSts2                    DrvSts2;
  131.  
  132. enum {
  133.     kdqManualEjectBit            = 5
  134. };
  135.  
  136. EXTERN_API( OSErr )
  137. DiskEject                        (short                     drvNum);
  138.  
  139. EXTERN_API( OSErr )
  140. SetTagBuffer                    (void *                    buffPtr);
  141.  
  142. EXTERN_API( OSErr )
  143. DriveStatus                        (short                     drvNum,
  144.                                  DrvSts *                status);
  145.  
  146.  
  147.  
  148. #if PRAGMA_STRUCT_ALIGN
  149.     #pragma options align=reset
  150. #elif PRAGMA_STRUCT_PACKPUSH
  151.     #pragma pack(pop)
  152. #elif PRAGMA_STRUCT_PACK
  153.     #pragma pack()
  154. #endif
  155.  
  156. #ifdef PRAGMA_IMPORT_OFF
  157. #pragma import off
  158. #elif PRAGMA_IMPORT
  159. #pragma import reset
  160. #endif
  161.  
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166. #endif /* __DISKS__ */
  167.  
  168.